package com.hclc.util.sftp;

import lombok.extern.slf4j.Slf4j;
import org.apache.maven.model.Model;

/**
 * @ClassName TestFileUpload
 * @Author: yurj
 * @Mail：1638234804@qq.com
 * @Date: Create in 10:47 2020/12/28
 * @version: 1.0
 */
@Slf4j
public class TestFileUpload {

    public static void main(String[] args) {
        try {

            SftpUtil builder = SftpUtil.builder();

            Model rootResource = MavenModelResourceUtil.getRootResource();
            System.out.println(rootResource.getArtifactId());
            System.out.println(rootResource.getVersion());
            //System.out.println(builder.objectIsExists("1.txt", SftpUtil.ObjectTypeEnum.OBJECT_FILE));
//            String directory = "/home/hjy/test2/";// 目标文件名
//            String uploadFile = "H:\\test.txt";// 本地文件名
//            String name = "__UNI__1E9BACD_1020103843.txt";
//            InputStream inputStream = new FileInputStream(uploadFile);
//            //String s = builder.uploadFile(name, inputStream, directory);
//            String s = URLConnection.guessContentTypeFromStream(inputStream);
//            String s1 = URLConnection.guessContentTypeFromName(name);
//            System.out.println(s1);
//            System.out.println(s);

        } catch (Exception e) {
            log.error("失败", e);
        }
    }
}
